<?php
/*
 * Creative Bulletin Board Generation 3
 * Version 1.0 Beta 1
 +------------------------------------
 * Forum Application: BBCode Parser Standalone Script
 * Started: September 21, 2009 06:23 PM
 * Script version: 1.0
 +------------------------------------
 */
class parser{
	public function parse($input){ /* DOES NOT Sanitize Inputs! */
		$txt = $input;
		$txt = preg_replace("#\[b\](.*)\[/b\]#si", "<b>${1}</b>", $txt);
		$txt = preg_replace("#\[i\](.*)\[/i\]#si", "<i>${1}</i>", $txt);
		$txt = preg_replace("#\[u\](.*)\[/u\]#si", "<u>${1}</u>", $txt);
		$txt = preg_replace("#\[s\](.*)\[/s\]#si", "<s>${1}</s>", $txt);
		return $txt;
	}
}
